import React from "react";
import { createBrowserRouter } from "react-router-dom";
import LayoutLv3Admin from "@/layout/LayoutLv3Admin";

const router = createBrowserRouter([
  {
    path: '/',
    Component: React.lazy(() => import('@/views/redirect')),
  },
  {
    path: '/login',
    Component: React.lazy(() => import('@/views/login')),
  },
  {
    path: '/admin',
    Component: LayoutLv3Admin,
    children: [
      {
        path: 'able/graph',
        Component: React.lazy(() => import('@/views/admin/able/Graph3'))
      },
      {
        path: 'able/timeLine',
        Component: React.lazy(() => import('@/views/admin/able/TimeLine'))
      },
    ]
  },
  {
    path: '/pages',
    Component: LayoutLv3Admin,
    children: [
      {
        path: 'data-table',
        Component: React.lazy(() => import('@/views/pages/data-table'))
      },
    ]
  },
  {
    path: '/test',
    Component: React.lazy(() => import('@/views/test')),
  },
  {
    path: '*',
    Component: React.lazy(() => import('@/views/404')),
  }
], {
  basename: `${import.meta.env.VITE_APP_BASE_URL}/`
})

export default router
